const mongoose = require("mongoose");
const uuid = require("uuid");

const patrolSchema = new mongoose.Schema(
  {
    _id: {
      type: String,
      required: [true, "you must tell us your patrol id"],
      default: uuid.v1,
    },
    lessonId: {
      type: String,
      ref:"Lesson",
      required: [true, "you must tell us your lessonId"]
    },
    // 评教人的信息
    userId: {
      type: String,
      ref: 'User',
    },
    patrolMessage: [
      {
        message: [
          {
            answer: String,
            options: [],
            question: String
          }
        ],
        patrolType: String
      }
    ],
  },
  {
    _id: false,
  }
);

const patrol = mongoose.model("PatrolComment", patrolSchema);

module.exports = patrol;
